<template>
  <div class="wrap">
    <div class="container w">
      <div class="allGoodsCat">
        <div @click="showCategory = !showCategory">
          <i class="iconfont icon-caidan"></i>
          <strong >所有产品分类</strong>
          <i :class="[showCategory ? 'el-icon-caret-top': 'el-icon-caret-bottom' ]"></i>
        </div>
        <div v-if="showCategory" class="category">
          <Category />
        </div>
      </div>
      <div class="menu">
        <ul>
          <li v-for="item in keys" :key="item.name">
            <a :href="item.url">{{ item.name }}</a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import Category from '@/mall/views/components/Category'
export default {
  name: "Menu",
  components: {
    Category
  },
  data() {
    return {
      keys: [
        { name: "网站首页", url: "/" },
        { name: "会员模板", url: "/" },
        { name: "商业模板", url: "/" },
        { name: "特价仿站", url: "/" },
        { name: "CMS教程", url: "/" },
        { name: "站长学院", url: "/" },
      ],
      showCategory:false,
    };
  },
};
</script>
<style lang="scss" scoped>
.w{
  width: 1200px;
  margin:0 auto;
  }
.wrap {
  height: 45px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
  background: #ed2d38;
  
}
.container {
  display: flex;
  font-size: 15px;
  height: 100%;
  align-items: center;
}
.category{
  position:absolute;
  top: 45px;
  z-index: 11;
}
.allGoodsCat {
  position: relative;
  font-size: 16px;
    color: #fff;
    width: 250px;
    height: 45px;
    line-height: 45px;
    background: rgba(97, 0, 0, 1);
    div:nth-child(1):hover{
      cursor:pointer;  
        strong{
          color: rgb(154, 174, 255);
        }
      }
    div:nth-child(1){
      display:flex;
      justify-content: space-around
    }
    .icon-caidan{
      line-height:45px;
      font-size:35px;
    }
    .el-icon-caret-bottom,
    .el-icon-caret-top
    {
      line-height:45px;
      font-size:20px;
    }
  }
.menu {
  font-weight: 600;
  color: #fff;
  font-size: 16px;
  margin-left: 20px;
  ul {
    display: flex;
    li {
      margin-right: 40px;
      a:hover{
        color: rgb(154, 174, 255);
      }
      a {
        letter-spacing: 1px;
      }
    }
  }
}
</style>
